<#import "../tpl/pageTep.ftl" as page>
<@page.pageBase currentMenu="佣金管理">
<style>
    .form-horizontal .controls  { line-height: 42px;}
    .span16 { width: 520px;}
    .form-horizontal .time-label { width: 60px;}
    .query-button{margin-left: 10px;}
</style>
<form id="searchForm" class="form-panel">
    <ul class="panel-content">
        <li>
            <div class="control-group span5">
                <div class="search-controls  controls">
                    <input type="text" name="title" id="title" value="" placeholder="搜索关键字">
                </div>
            </div>
            <div class="form-actions span2">
                <button type="submit" class="button  button-primary">
                    搜索
                </button>
            </div>
            <div class="span16">
                <label class="time-label control-label">起始日期：</label>

                <div class="controls">
                    <input name="start" class="input-small calendar" type="text"><label>&nbsp;-&nbsp;</label><input
                        name="end" class="input-small calendar" type="text">
                </div>
                <a class="query-button button button-primary">
                    查询
                </a>
            </div>

        </li>
        <li>
            <div class="span4 control-group">
                <a class="button button-success" href="${basepath}/manage/organize/toAC">
                    提现明细
                </a>
            </div>
        </li>
    </ul>
</form>
<div id="grid"></div>
<script>
    /*-------------------------------------------------------- 表格数据渲染start-----------------------------------*/
    var Grid = BUI.Grid,
            Store = BUI.Data.Store,
            columns = [
                {title: '申请日期', dataIndex: ''},
                {title: '机构名称', dataIndex: '',width:'200'},
                {title: '收款人', dataIndex: ''},
                {title: '收款账号', dataIndex: '',width:'250'},
                {title: '帐号类型', dataIndex: ''},
                {title: '申请人', dataIndex: ''},
                {title: '提现金额', dataIndex: ''},
                {title: '状态', dataIndex: ''},
                {
                    title: '操作', dataIndex: 'id',renderer: function (value) {
                    return '<a href="${basepath}/manage/organize/toAC?id=' + value + '"">审核</a>';
                }
                }
            ];
    var store = new Store({
                url: 'loadData',
                autoLoad: true, //自动加载数据
                params: { //配置初始请求的参数
                    length: '10',
                    status: $("#phone").val()
                },
                pageSize: 10,	// 配置分页数目
                root: 'list',
                totalProperty: 'total'
            }),
            grid = new Grid.Grid({
                render: '#grid',
                columns: columns,
                loadMask: true, //加载数据时显示屏蔽层
                store: store,
                plugins: [Grid.Plugins.CheckSelection], // 插件形式引入多选表格

                // 底部工具栏
                bbar: {
                    pagingBar: true
                }
            });
    grid.render();

    var form = new BUI.Form.HForm({
        srcNode: '#searchForm'
    }).render();

    form.on('beforesubmit', function (ev) {
        //序列化成对象
        var obj = form.serializeToObject();
        obj.start = 0; //返回第一页
        store.load(obj);
        return false;
    });
    /*-------------------------------------------------------- 表格数据渲染end-----------------------------------*/

</script>
</@page.pageBase>